package com.yanqu.road.server.gameplayer.module.cricket.entity.business;


import com.yanqu.road.server.gameplayer.module.cricket.entity.DbUserCricketBattleLog;
import com.yanqu.road.server.gameplayer.module.cricket.entity.DbUserCricketBattleLogDetail;
import com.yanqu.road.server.gameplayer.module.cricket.entity.DbUserCricketWaitSendBattleLog;
import com.yanqu.road.server.gameplayer.module.cricket.entity.dao.UserCricketBattleLogDaoImpl;
import com.yanqu.road.server.gameplayer.module.cricket.entity.dao.UserCricketBattleLogDetailDaoImpl;
import com.yanqu.road.server.gameplayer.module.cricket.entity.dao.UserCricketWaitSendBattleLogDaoImpl;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class CricketGameBusiness {

    public static DbUserCricketBattleLog saveDbUserCricketBattleLog(DbUserCricketBattleLog data) {
        return UserCricketBattleLogDaoImpl.newInstance().addDataWithAutoIncrement(data);
    }

    public static Map<Long, DbUserCricketBattleLog> getDbUserCricketBattleLogMap(long userId, int limit) {
        return UserCricketBattleLogDaoImpl.newInstance().getDataMap(userId, limit);
    }

    public static boolean saveDbUserCricketBattleLogDetail(DbUserCricketBattleLogDetail data) {
        return UserCricketBattleLogDetailDaoImpl.newInstance().saveData(data);
    }

    public static DbUserCricketBattleLogDetail getDbUserCricketBattleLogDetail(long battleLogId) {
        return UserCricketBattleLogDetailDaoImpl.newInstance().getData(battleLogId);
    }

    public static ConcurrentHashMap<Long, DbUserCricketWaitSendBattleLog> getDbUserCricketWaitSendBattleLogList() {
        return UserCricketWaitSendBattleLogDaoImpl.newInstance().getDataMap();
    }

    public static boolean saveDbUserCricketWaitSendBattleLog(DbUserCricketWaitSendBattleLog data) {
        return UserCricketWaitSendBattleLogDaoImpl.newInstance().saveData(data);
    }

}
